@import '../style/theme/color';
@import '../style/theme/shadow';
@import '../style/core/animation';
@import '../style/theme/corner';

@mixin fixed-arrow-button() {
  position: absolute;
  top: -18px;
  z-index: 2;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 100%;
  background: $devui-highlight-overlay;
  box-shadow: $devui-shadow-length-hover $devui-light-shadow;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: $devui-area;
  }

  svg polygon {
    fill: $devui-text;
  }
}

.devui-carousel-container {
  display: block;
  position: relative;

  .devui-carousel-arrow {
    position: absolute;
    width: 100%;
    top: 50%;

    .arrow-left {
      @include fixed-arrow-button();

      left: 10px;
    }

    .arrow-right {
      @include fixed-arrow-button();

      right: 10px;
    }
  }

  .devui-carousel-item-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;

    .devui-carousel-item-container {
      display: flex;
      height: 100%;
      position: relative;

      ::ng-deep d-carousel-item {
        flex: 1;
        position: relative;
        height: 100%;
      }
    }
  }

  .devui-carousel-dots {
    position: absolute;
    display: flex;
    justify-content: center;
    width: 100%;

    &.bottom {
      bottom: 8px;
    }

    &.top {
      top: 8px;
    }

    .dot-item {
      width: 6px;
      height: 6px;
      border-radius: $devui-border-radius-feedback;
      margin-right: 8px;
      background: $devui-icon-fill;
      cursor: pointer;

      .dot-item-active-progress {
        width: 0;
        display: inline-block;
        position: absolute;
      }

      &:hover {
        background: $devui-icon-fill-hover;
      }

      &.active {
        width: 24px;
        background-color: $devui-icon-fill;
        transition: all $devui-animation-duration-fast $devui-animation-ease-in-out-smooth;

        .dot-item-active-progress {
          width: 24px;
          height: 6px;
          background-color: $devui-icon-fill-active;
          border-radius: $devui-border-radius-feedback;
          transition-property: width;
          transition-timing-function: $devui-animation-ease-out;
        }
      }
    }
  }
}

.devui-carousel-container {
  .devui-carousel-arrow {
    .arrow-left,
    .arrow-right {
      transition: background-color $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;
    }
  }
}
